input_file = 'GB2312.cst'
output_file = 'GB2312_out.cst'
import_list = []
export_list = []

with open(input_file, 'rb') as file:
	while True:
		data = file.read(2)

		if not data:
			break

		import_list.append(int.from_bytes(data, 'big'))

import_list.sort()

for index in range(len(import_list) - 8500):
	if index > 0:
		if import_list[index] - 1 != import_list[index - 1]:
			print(f'\n{import_list[index]}, ', end='')
		else:
			print(f'{import_list[index]}, ', end='')
	else:
		print(f'{import_list[index]}, ', end='')


# with open(output_file, 'wb') as file:
# 	for data in import_list:
# 		export_list.append(int.to_bytes(data, 2, 'big'))
# 		file.write(int.to_bytes(data, 2, 'big'))

# print(len(export_list))
